package Problem9;

public class Main {

	public static void main(String[] args) {
		// conditions
		// a + b + c = 1000
		// a < b < c
		// a^2 + b^2 = c^2
		System.out.println(solve());
	}
	public static long solve(){
		for (long c = 1; c < 500; c ++) {
			for (long b = 1; b < 500; b++){
				if (b > c)
					break;
				for (long a = 1; a < 500; a++) {
					if (a > b)
						break;
					if (a + b + c != 1000)
						continue;
					if ((a * a) + (b * b) == (c * c)) {
						return a * b * c;
					}	
				}
			}
		}
		return 1;
	}

}
